//
//  ShowView.m
//  fuxi
//
//  Created by dllo on 16/6/19.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "ShowView.h"

@interface ShowView()<UITextFieldDelegate>

@end

@interface ShowView()

@end

@implementation ShowView

-(void)dealloc
{
    [_textField release];
    [_textLabel release];
    [super dealloc];
}

-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    
    if (self) {
        [self createSubView];
    }
    return self;
    
}

-(void)createSubView
{
    /**textLabel*/
    self.textLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.bounds) / 3, CGRectGetHeight(self.bounds))];
    
    self.textLabel.backgroundColor = [UIColor clearColor];
    
    self.textLabel.textAlignment = NSTextAlignmentCenter;
    
    [self addSubview:self.textLabel];
    
    self.textLabel.font = [UIFont systemFontOfSize:20];
    
    [self.textLabel release];
    
    /**textField*/
    self.textField = [[UITextField alloc]initWithFrame:CGRectMake(CGRectGetWidth(self.textLabel.bounds) + 10, 0, CGRectGetWidth(self.bounds) / 3 * 2 - 10, CGRectGetHeight(self.bounds))];
    
    self.textField.backgroundColor = [UIColor clearColor];
    
    self.textField.borderStyle = UITextBorderStyleRoundedRect;
    
    [self.textField.layer setMasksToBounds:YES];
    
    [self.textField.layer setCornerRadius:10.0];
    
    [self.textField.layer setBorderWidth:0.5];
    
    self.textField.delegate = self;
    
    [self addSubview:self.textField];
    
    self.textField.font = [UIFont systemFontOfSize:20];
    
    [self.textField release];
    
}

/**键盘回收*/
-(BOOL)textFieldShouldReturn:(UITextField *)textField
{
    [textField resignFirstResponder];
    
    return YES;
}






@end












